{extend name="../front" /}
{block name="head"}
<title>{$title}－{:config('site.title')}</title>
<meta name="keywords" content="{$keywords}" />
<meta name="description" content="{$description}" />
<meta name="referrer" content="never">
{/block}
{block name="main"}
<main class="container">
  <div class="card mb-3">
    <div class="card-body">
      <h5 class="card-title fw-bold">{$title}</h5>
      <p class="card-text text-muted">
        {$description}<a class="fw-bold ms-1" id="btn-test" href="javascript:;" data-target="#post-text" data-content="https://v.douyin.com/iRGr7mdU/ 复制此链接，打开Dou音搜索，直接观看视频！">点击这里输入测试链接</a>
      </p>
      <form class="row g-3 mb-0" action="{:dcUrl('index/text/save')}" id="parse" method="post" target="_blank">
        <input type="hidden" name="post[id]" value="{$id}">
        {volist name="fields" id="item"}
        <div class="{$item.class|default='col-12'}">
          <textarea class="form-control fs-0" rows="{$item.rows|default=3}" name="post[{$key}]" id="post-{$key}" placeholder="{$item.tips}" required>{$item.value}</textarea>
        </div>
        {/volist}
        <div class="col-auto">
          <button type="button" class="btn btn-sm btn-secondary btn-trash me-3" data-target=".form-control">清空内容</button>
          <button type="submit" class="btn btn-sm btn-primary">开始转换<i class="iconfont icon-loading hidden fs-0 ms-1"></i></button>
        </div>
      </form>
    </div>
  </div>
  <div class="card hidden" id="result">
    <div class="card-body">
      <h6 class="card-title fw-bold"><i class="iconfont icon-file me-1"></i>文案提取结果</h6>
      <p class="card-text text-muted fs-0 mb-2" id="desc">作品标题</p>
      <p class="card-text"><textarea class="form-control fs-0" rows="15" id="text"></textarea></p>
      <p class="card-text">
        <button class="btn btn-sm btn-secondary btn-copy me-3" type="button" data-clipboard-action="copy" data-clipboard-target="#text">一键复制文案</button>
      </p>
    </div>
  </div>
</main>
{/block}